package com.homework.question2;

/**
 * @ClassName triangle
 * @Description TODO
 * @Author hp
 * @Date 2021/6/16 18:07
 * @Version 1.0
 **/
public class Triangle implements Graphic{
    private double base;
    private double heigth;

    public Triangle(double base, double heigth) {
        this.base = base;
        this.heigth = heigth;
    }

    public double getBase() {
        return base;
    }

    public void setBase(double base) {
        this.base = base;
    }

    public double getHeigth() {
        return heigth;
    }

    public void setHeigth(double heigth) {
        this.heigth = heigth;
    }

    @Override
    public double area() {
        return base*heigth/2;
    }
}
